/**
 * Created by user on 2018/11/27.
 */
import { QaFooterActionType } from '../actions/qaFooterAction'
import { cloneDeep } from 'lodash'
import merge from 'webpack-merge'


const qa_footer_state = {
  footer_value: '',
  qaType: 'common'
}

const QaFooterState = (state = qa_footer_state, action) => {
  switch (action.type) {
    case QaFooterActionType.set_footer_value:
      return merge({}, state, {
        footer_value: action.value
      })
    case QaFooterActionType.toggle_qa_type:
      return Object.assign({}, state, {
        qaType: action.payload.qaType
      })
    default:
      return state
  }
}
QaFooterState._default_state = qa_footer_state
export default QaFooterState
